package thread;

/**
 * @Description: null
 * @Project: testDemo
 * @Author: hjibo
 * @CreateDate: 2019/1/25 11:03
 * @ModificationHistory: （who whatTime doWhat）
 */
public class ThreadDemo6 implements Runnable {
    @Override
    public void run() {
        Thread.currentThread().setName("线程ThreadDemo6");
        for (int i = 0; i < 5; i++) {
            if(Thread.currentThread().isInterrupted()){
                System.out.println("收到退出标志");
                break;
            }
            System.out.println("这里是线程：" + Thread.currentThread().getName() + "，" + i);
        }
    }
}
